<?php
/* @var $this PromotionController */

//行业一级分类
$cateTop = Category::model()->getTopCache();

?>
<div class="grid_01 c_f">
	<!--轮播 首页A1 32 start-->
	<div class="prom_slide w_700 f_l">
		<div id="slideBox" class="slideimg">
			<ul id="slideContent">
				<?php $adzone = Adzone::model()->getData(32);
				if(!empty($adzone)){ foreach( (array)$adzone['ads'] as $key=>$value){?>
				<li>
					<?php echo CHtml::link(CHtml::image($value['zds_file_url'],$value['zds_desc'],array('height'=>$adzone['zdz_height'],'width'=>$adzone['zdz_width']),$value['zds_url'],array('target'=>'_blank')))?>
				</li>
				<?php }}?>
			</ul>
		</div>
		<ul id="slideTab" class="slidetab">
			<li>1</li>
			<li>2</li>
			<li>3</li>
			<li>4</li>
			<li>5</li>
		</ul>
	</div>
	<!--轮播 首页A1 32 end-->
	<div class="latest_prom w_250 f_r bg_fff">
		<div class="hd c_green2 ff_yh fs_16 fw_b">最新促销</div>
		<?php $hotpro = Positions::model()->getPosData('24');?>
		<div class="bd">
			<ul class="prom_tab" id="promTab">
				<li class="ico"></li>
				<li class="ico"></li>
				<li class="ico"></li>
			</ul>
			 <div id="promBox" class="prombox">
				 <ul id="promContent" class="prom_cont">
					<?php if(!empty($hotpro)){ foreach($hotpro as $data){?>
					<li class="item">
						<div class="c_img c_img60">
							<?php echo CHtml::link(Tool::thumb($data->discount->product->zp_pic,60,60,$data->discount->product->zp_name),array('/home/product/detail','id'=>$data->discount->product->zp_id,'active'=>'discount'))?>
						</div>
						<p class="title_pro c_666">
							<?php echo CHtml::link(mb_substr($data->discount->product->zp_name,0,20,'utf8'),array('/home/product/detail','id'=>$data->discount->product->zp_id,'active'=>'discount')) ?>
						</p>
						<p class="price ff_yh">
							<del class="f_r c_999">&yen;<?php echo $data->discount->product->zp_price?></del>
							<b class="ico ico_cx"></b>
							<strong class="fs_14 c_orange">&yen;<?php echo number_format($data->discount->product->zp_price*$data->discount->zpd_discount/10,2,'.','')?></strong>
						</p>
					</li>
					<?php }}?>
				</ul>
			</div>
		</div>
		<p class="prom_bg"></p>
	</div>
	<script type="text/javascript">
		var QQMarqueeControl=new Marquee(["promBox","promContent","promTab","onclick"],0,0.5,250,245,20,3000,3000)
	</script>
</div>
<div class="hr_15"></div>
<!--特价促销 start-->
<div class="tejia_prom bg_fff">
	<div class="prom_pub_hd bg_x"><h2 class="fs_20 ff_yh"><em class="c_orange">特价</em><em class="c_green2">促销</em><span class="bg bg_sale"></span></h2></div>
	<div class="bd list_hover">
		<ul class="list01 c_f">
		<?php $hotpro = Positions::model()->getPosData('25');?>
			<?php if(!empty($hotpro)){  foreach($hotpro as $key=>$data){?>
			<li class="item c_f <?php if($key==0) echo "first"?>">
				<div class="c_img c_img160 f_l">
					<?php echo CHtml::link(Tool::thumb($data->discount->product->zp_pic,160,160,$data->discount->product->zp_name),array('/home/product/detail','id'=>$data->discount->product->zp_id,'active'=>'discount'))?>
				</div>
				<p class="title c_666 fs_14 fw_b">
					<?php echo CHtml::link(mb_substr($data->discount->product->zp_name,0,20,'utf8'),array('/home/product/detail','id'=>$data->discount->product->zp_id,'active'=>'discount')) ?>
				</p>
				<p class="price fw_b ff_yh">
					<span class="bg bg_price"></span>
					<span class="c_orange fs_24 d_b">&yen;<?php echo number_format($data->discount->product->zp_price*$data->discount->zpd_discount/10,2,'.','')?></span>
					<del class="c_999">原价：<?php echo $data->discount->product->zp_price?>元</del>
				</p>
			</li>
			<?php }}?>
		</ul>
		<ul class="list02 c_f">
			<?php $hotpro = Positions::model()->getPosData('26');?>
			<?php if(!empty($hotpro)){ foreach($hotpro as $key=>$data){?>
			<li class="item first c_f">
				<div class="c_img c_img120 f_l">
					<?php echo CHtml::link(Tool::thumb($data->discount->product->zp_pic,120,120,$data->discount->product->zp_name),array('/home/product/detail','id'=>$data->discount->product->zp_id,'active'=>'discount'))?>
				</div>
				<p class="title title_pro c_666">
					<?php echo CHtml::link(mb_substr($data->discount->product->zp_name,0,20,'utf8'),array('/home/product/detail','id'=>$data->discount->product->zp_id,'active'=>'discount')) ?>
				</p>
				<p class="price fw_b ff_yh">
					<span class="bg bg_price"></span>
					<span class="c_orange fs_24 d_b">&yen;<?php echo number_format($data->discount->product->zp_price*$data->discount->zpd_discount/10,2,'.','')?></span>
					<del class="c_999">原价：<?php echo $data->discount->product->zp_price?>元</del>
				</p>
			</li>
			<?php }}?>
		</ul>
	</div>
</div>
<!--特价促销 end-->
<div class="hr_12"></div>
<!--更多促销 start-->
<div class="prom_more list_hover">
	<div class="hd bg_fff">
		<span class="fs_20 ff_yh fw_b"><em class="c_orange">更多</em><em class="c_green2">促销</em></span>
		<span class="categ fs_14">
		<?php echo CHtml::link('全部<b class="bg_x left"></b><b class="bg_x right"></b></a>',array('list','id'=>""),array('class'=>'cur'))?>
		<?php foreach($cateTop as $key=>$cate){?>
			<?php echo CHtml::link(CHtml::encode($cate->zca_title).'<b class="bg_x left"></b><b class="bg_x right"></b></a>',array('list','id'=>$cate->zca_id),array('class'=>''))?>
		<?php }?>
		</span>
	</div>
	<div class="bd pro_list">
		<ul class="list c_f">
			<?php $hotpro = Positions::model()->getPosData('27');?>
			<?php if(!empty($hotpro)){ foreach($hotpro as $key=>$data){?>
			<li class="item">
				<div class="c_img c_img210">
					<?php echo CHtml::link(Tool::thumb($data->discount->product->zp_pic,210,210,$data->discount->product->zp_name),array('/home/product/detail','id'=>$data->discount->product->zp_id,'active'=>'discount'))?>
				</div>
				<p class="price ff_yh">
					<del class="c_999 f_r">&yen;<?php echo $data->discount->product->zp_price?></del>
					<strong class="c_orange fs_14">&yen;<?php echo number_format($data->discount->product->zp_price*$data->discount->zpd_discount/10,2,'.','')?></strong>
				</p>
				<p class="title fs_14 c_666">
					<?php echo CHtml::link(mb_substr($data->discount->product->zp_name,0,20,'utf8'),array('/home/product/detail','id'=>$data->discount->product->zp_id,'active'=>'discount')) ?>
				</p>
				<span class="bg bg_pro"></span>
			</li>
			<?php }}?>
		</ul>
	</div>
</div>
<!--更多促销 end-->
<?php $adzone = Adzone::model()->getData(59,$cid=0);if(!empty($adzone)){ foreach($adzone['ads'] as $key=>$val){?>
<div class="ad"><?php echo CHtml::link(Tool::thumb($val["zds_file_url"],$adzone['zdz_width'],$adzone['zdz_height']),$val['zds_url'],array('alt'=>$val['zds_desc'],'target'=>'_blank'))?></div>	
<?php }}?>
</div>

<div class="allsort_nav promotion_sort bg_fff">
    <h2 class="ff_yh fs_15">促销分类</h2>
    <ul>
    	<?php foreach($cateTop as $key=>$cate){?>
			<li><?php echo CHtml::link('<b class="ico ico_sort'.($key+1).'"></b>'.CHtml::encode($cate->zca_title),array('list','id'=>$cate->zca_id))?></li>
		<?php }?>
    </ul>
    <p class="view_all t_c">
    	<?php echo CHtml::link('查看全部促销',array('list','id'=>''),array('alt'=>'查看全部促销'))?>
    </p>	
</div>

<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/style/style_promotion.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(function(){
	$(".list_hover").Prolist();
	new Marquee(
			{
			MSClassID : "slideBox",
			ContentID : "slideContent",
			TabID : "slideTab",
			Direction : 2,
			Step : 0.3,
			Width : 700,
			Height : 280,
			Timer : 20,
			DelayTime : 2000,
			WaitTime : 0,
			ScrollStep: 1,
			SwitchType: 2,
			AutoStart : 1
			})
});
</script>
